package com.jiepu.homework.adapter;

import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

public class GUIDemo {

	public static void main(String[] args) {
		JFrame frame = new JFrame();
		frame.setBounds(200, 200, 400, 400);
		
		JButton button = new JButton("测试按钮");
		frame.add(button, BorderLayout.CENTER);
		
		button.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseEntered(MouseEvent e) {
				System.out.println("鼠标进来了....");
			}
			@Override
			public void mouseExited(MouseEvent e) {
				System.out.println("鼠标出去了....");
			}
		});
		
		frame.setVisible(true);
	}
}
